/**      
 * @file		characterCodesV1.cpp
 * @description		Demonstrates the conversion of a lowercase letter
 *			to an uppercase letter. 
 * @course		CSCI 123 Section 00000
 * @assignment		Sample 13
 * @date		10/20/2006
 * @author		Brad Rippe (00000000) brippe@fullcoll.edu
 * @version		1.0
 */
#include <iostream>
using namespace std;

/**
 * @return zero if the application executes successfully
 */
int main() {
	char theChar = '1';	

	while(theChar != '0') {
		cout << "Please type a lowercase character ";
		cout << "and I will make it uppercase.\n";

		cin >> theChar;

		if(theChar < 'a' || theChar > 'z') {
			cout << "You've typed an invalid character!\n";
			cout << "Please try again\n";
			continue;	// what's the continue do again?
		}

		// 'A'-'a' is evaluated to -32
		// this is the integer value that will convert
		// a lowercase letter to an uppercase character
		// if we don't want the character to be output
		// as a integer we have to set the result of our
		// conversion to a char variable. This tells the 
		// compiler that we want the char value. 
		char upperChar = theChar+'A'-'a';
		cout << "You typed the character '" << theChar
			 << "'\n";
		cout << "I can capitalize the char '" << upperChar
			 << "'\n";
		
		cout << "Would you like to continue?\n";
		cout << "Type '1' for yes and '0' for no\n";

		cin >> theChar;
	}
	return 0;
}

